package lol.clann.minecraft.springboot.plugin.core.ddl;

import lol.clann.minecraft.springboot.api.spi.ddl.DDL;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

@Component
public class SbpDDL1 implements DDL {
    @Override
    public int getVersion() {
        return 1;
    }

    @Override
    public List<String> getSqls() {
        List<String> sqls = new ArrayList<>();
        sqls.add("create table `sbp_bank` (\n" +
                "  `id`      bigint(20) unsigned not null auto_increment,\n" +
                "  `player`  varchar(64)         not null,\n" +
                "  `amount`  decimal(20, 4)      not null default 0,\n" +
                "  `type`  varchar(16)      not null,\n" +
                "  `updated` timestamp            not null default current_timestamp() on update current_timestamp(),\n" +
                "  `created` timestamp            null,\n" +
                "  primary key (`id`),\n" +
                "  key `sbp_plugin_sbp_bank_idx_player` (`player`)\n" +
                ")");
        return sqls;
    }
}
